home *** CD-ROM | disk | FTP | other *** search
Text File | 2011-09-24 | 65.3 KB | 1,495 lines |
- function §\x04\x05§()
- {
- set("\x03",1193 % 511 * true);
- return eval("\x03");
- }
- var §\x01§ = 596 + "\x04\x05"();
- while(true)
- {
- if(eval("\x01") == 767)
- {
- set("\x01",eval("\x01") - 257);
- §§push(true);
- }
- else if(eval("\x01") == 601)
- {
- set("\x01",eval("\x01") - 505);
- }
- else if(eval("\x01") == 961)
- {
- set("\x01",eval("\x01") - 865);
- }
- else if(eval("\x01") == 413)
- {
- set("\x01",eval("\x01") - 164);
- var §§pop() = function §\x04\x05§()
- {
- set("\x03",1193 % 511 * true);
- return eval("\x03");
- };
- }
- else
- {
- if(eval("\x01") == 657)
- {
- set("\x01",eval("\x01") - 56);
- break;
- }
- if(eval("\x01") == 96)
- {
- set("\x01",eval("\x01") + 317);
- §§push("\x0f");
- §§push(1);
- }
- else if(eval("\x01") == 510)
- {
- set("\x01",eval("\x01") + 147);
- if(function §\x04\x05§()
- {
- set("\x03",1193 % 511 * true);
- return eval("\x03");
- })
- {
- set("\x01",eval("\x01") - 56);
- }
- }
- else if(eval("\x01") == 249)
- {
- set("\x01",eval("\x01") - 88);
- §§push("\x0f");
- }
- else if(eval("\x01") == 161)
- {
- set("\x01",eval("\x01") - 130);
- §§push(eval(function §\x04\x05§()
- {
- set("\x03",1193 % 511 * true);
- return eval("\x03");
- }));
- }
- else if(eval("\x01") == 31)
- {
- set("\x01",eval("\x01") + 434);
- §§push(!function §\x04\x05§()
- {
- set("\x03",1193 % 511 * true);
- return eval("\x03");
- });
- }
- else
- {
- if(eval("\x01") == 602)
- {
- set("\x01",eval("\x01") + 386);
- stop();
- _global.firstplay = true;
- _global.score = 0;
- game = {score:0};
- if(_global.firstplay)
- {
- game.level = 1;
- _global.firstplay = false;
- }
- var pos1achieve = false;
- var pos2achieve = false;
- _global.item = false;
- _global.timeStep = 0;
- _global.oldPos = 0;
- _global.debugTrace = function(txt)
- {
- debug_txt.text = txt;
- trace(txt);
- };
- loadLevel = function(lvl)
- {
- _root.attachMovie("skybackground","skybackground",0);
- stopAllSounds();
- _root.paws = false;
- _root.panels._visible = false;
- trace("setting up level");
- _global.double = false;
- _global.cavemanPos = 0;
- _global.walking = false;
- _global.step = 1;
- _root.paws = false;
- game.level = lvl;
- switch(lvl)
- {
- case 1:
- _root.attachMovie("level1","gamelevel",1);
- _global.stick = false;
- _global.rock = false;
- _global.crocs = false;
- _global.screenY = 0;
- _global.screenX = 0;
- setTimeOut(birdfall,2000);
- _global.stickGlow = function()
- {
- _root.gamelevel.stick_mc.play();
- };
- _global.buttonVis = function(btn)
- {
- _root.gamelevel.button_1._visible = false;
- _root.gamelevel.button_2._visible = false;
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_6._visible = false;
- _root.gamelevel.button_7._visible = false;
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_9._visible = false;
- i = 0;
- while(i < btn.length)
- {
- var _loc2_ = btn[i];
- _root.gamelevel[_loc2_]._visible = true;
- i++;
- }
- };
- _global.buttonVis(["button_1","button_2"]);
- _global.stepTrue = function(pos)
- {
- if(pos == _global.cavemanPos)
- {
- return false;
- }
- switch(pos)
- {
- case 1:
- if(_global.step == 1)
- {
- _root.gamelevel.char._alpha = 0;
- _root.gamelevel.caveman_crocs._alpha = 100;
- _root.gamelevel.caveman_crocs.play();
- }
- break;
- case 3:
- if(_global.step == 2)
- {
- return true;
- }
- break;
- case 4:
- if(_global.step == 2)
- {
- return true;
- }
- break;
- case 6:
- if(_global.step == 3)
- {
- trace("CROC + " + _global.crocs);
- if(!_global.crocs)
- {
- _global.goPlayAnim = "caveman_5_7";
- }
- else
- {
- _global.goPlayAnim = "caveman_5_6";
- }
- _root.gamelevel.crocs2.crocs.stop();
- _global.walking = true;
- _root.gamelevel.char._visible = false;
- _root.gamelevel[_global.goPlayAnim]._visible = true;
- _root.gamelevel[_global.goPlayAnim]._alpha = 100;
- _root.gamelevel[_global.goPlayAnim].gotoAndPlay(2);
- _global.debugTrace("walking from pos " + _global.cavemanPos + " to pos " + pos);
- _global.step = 4;
- }
- break;
- case 7:
- if(_global.step == 4)
- {
- _global.step = 4;
- _global.rock = true;
- return true;
- }
- break;
- case 8:
- if(_global.step == 4)
- {
- return true;
- }
- break;
- case 9:
- if(_global.step == 4)
- {
- return true;
- }
- break;
- default:
- break;
- case 2:
- if(_global.step == 1)
- {
- _global.step = 2;
- _global.buttonVis([]);
- return true;
- }
- return false;
- break;
- case 5:
- _global.step = 3;
- return true;
- }
- return false;
- };
- _global.buttonCheck = function(flag)
- {
- trace("CHECKIN");
- _global.walking = false;
- _root.step_txt.text = "step - " + _global.step;
- _root.pos_txt.text = "pos - " + _global.cavemanPos;
- switch(_global.cavemanPos)
- {
- case 1:
- return 3;
- case 2:
- _global.buttonVis(["button_3","button_4"]);
- return 1;
- case 3:
- _global.stick = true;
- _global.buttonVis(["button_4"]);
- return 5;
- case 4:
- if(_global.stick)
- {
- _global.buttonVis(["button_6"]);
- _root.gamelevel.boulder.play();
- _global.goPlayAnim = "caveman_4_4";
- setTimeout(goPlay,3000);
- return 4;
- }
- return 2;
- break;
- case 5:
- _global.step = 3;
- return 1;
- case 6:
- if(!_global.crocs)
- {
- _global.buttonVis(["button_7","button_8","button_9"]);
- return 1;
- }
- return 3;
- break;
- case 7:
- _global.buttonVis(["button_8","button_9"]);
- return 1;
- case 8:
- return 1;
- case 9:
- if(_global.rock)
- {
- _global.buttonVis(["button_8"]);
- return 1;
- }
- return 3;
- break;
- default:
- return 1;
- }
- };
- break;
- case 2:
- _root.attachMovie("level2","gamelevel",1);
- _root.gamelevel._y = -420;
- _global.screenY = -420;
- _global.screenX = 0;
- _global.stick = false;
- _global.rock = false;
- _global.flint = false;
- _global.boulder = false;
- _global.fire = false;
- _global.buttonVis = function(btn)
- {
- _root.gamelevel.button_1._visible = false;
- _root.gamelevel.button_2._visible = false;
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_6._visible = false;
- _root.gamelevel.button_7._visible = false;
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_9._visible = false;
- _root.gamelevel.button_10._visible = false;
- _root.gamelevel.button_11._visible = false;
- _root.gamelevel.button_12._visible = false;
- i = 0;
- while(i < btn.length)
- {
- var _loc2_ = btn[i];
- _root.gamelevel[_loc2_]._visible = true;
- i++;
- }
- };
- _global.buttonVis(["button_1","button_2"]);
- _global.stepTrue = function(pos)
- {
- if(pos == _global.cavemanPos)
- {
- return false;
- }
- switch(pos)
- {
- case 1:
- if(_global.step == 1)
- {
- _global.stick = true;
- return true;
- }
- break;
- case 2:
- if(_global.step == 1)
- {
- _global.rock = true;
- return true;
- }
- break;
- case 3:
- if(_global.step == 1 && _global.stick && _global.rock)
- {
- _global.step = 2;
- return true;
- }
- break;
- case 4:
- if(_global.step == 2)
- {
- return true;
- }
- break;
- case 5:
- if(_global.step == 2)
- {
- _global.step = 3;
- return true;
- }
- break;
- case 6:
- if(_global.step == 3)
- {
- _global.flint = true;
- return true;
- }
- break;
- case 7:
- if(_global.step == 3)
- {
- if(!_global.flint)
- {
- return true;
- }
- _global.screenX = -574;
- _global.screenY = -103;
- _root.gamelevel.char._visible = false;
- _root.gamelevel.caveman_run_1._alpha = 100;
- _root.gamelevel.caveman_run_1.play();
- _global.step = 4;
- }
- break;
- case 8:
- if(_global.step == 4)
- {
- return true;
- }
- break;
- case 9:
- if(_global.step == 4)
- {
- _root.gamelevel.char._visible = false;
- }
- _root.gamelevel.caveman_run_2._alpha = 100;
- _root.gamelevel.caveman_run_2.play();
- _global.step = 5;
- break;
- case 10:
- if(_global.step == 5)
- {
- trace("DEAD");
- return true;
- }
- break;
- case 11:
- if(_global.step == 5)
- {
- _global.fire = true;
- return true;
- }
- break;
- case 12:
- if(_global.step == 5)
- {
- _global.boulder = true;
- _global.buttonVis(["button_10","button_11"]);
- return true;
- }
- break;
- }
- return false;
- };
- _global.buttonCheck = function(flag)
- {
- trace("CHECKIN");
- _global.walking = false;
- _root.step_txt.text = "step - " + _global.step;
- _root.pos_txt.text = "pos - " + _global.cavemanPos;
- switch(_global.cavemanPos)
- {
- case 1:
- if(_global.rock)
- {
- _global.buttonVis(["button_3"]);
- setTimeout(addItem,1500,18);
- }
- else
- {
- _global.buttonVis(["button_2"]);
- }
- return 1;
- case 2:
- if(_global.stick)
- {
- _global.buttonVis(["button_3"]);
- setTimeout(addItem,1500,18);
- }
- else
- {
- _global.buttonVis(["button_1"]);
- }
- return 1;
- case 3:
- _global.buttonVis(["button_4"]);
- _global.screenY = -176;
- return 1;
- case 4:
- _global.buttonVis(["button_5"]);
- return 1;
- case 5:
- _global.buttonVis(["button_6","button_7"]);
- _global.step = 3;
- _global.screenX = -224;
- _global.screenY = -103;
- return 1;
- case 6:
- return 1;
- case 7:
- return 1;
- case 8:
- return 3;
- case 9:
- return 1;
- case 10:
- return 3;
- case 11:
- if(_global.boulder)
- {
- _global.buttonVis([]);
- }
- else
- {
- _global.buttonVis(["button_10","button_12"]);
- }
- return 1;
- case 12:
- if(_global.fire)
- {
- _global.buttonVis([]);
- _root.gamelevel.fire4._alpha = 100;
- }
- else
- {
- _global.buttonVis(["button_10","button_11"]);
- }
- return 1;
- default:
- return 1;
- }
- };
- break;
- case 3:
- _root.attachMovie("level3","gamelevel",1);
- _global.screenY = 0;
- _global.screenX = 0;
- _global.width = 836.8;
- _global.stick = false;
- _global.stick2 = false;
- _global.rock = false;
- _global.sinew = false;
- _global.wolvesfed = false;
- _global.wolfscare = 0;
- _global.water = false;
- _global.waterstart = false;
- _global.deerscare = false;
- _global.buttonVis = function(btn)
- {
- _root.gamelevel.button_1._visible = false;
- _root.gamelevel.button_2._visible = false;
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_6._visible = false;
- _root.gamelevel.button_7._visible = false;
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_9._visible = false;
- _root.gamelevel.button_10._visible = false;
- i = 0;
- while(i < btn.length)
- {
- var _loc2_ = btn[i];
- _root.gamelevel[_loc2_]._visible = true;
- i++;
- }
- };
- _global.buttonVis(["button_1","button_2","button_3"]);
- _global.stepTrue = function(pos)
- {
- if(pos == _global.cavemanPos)
- {
- return false;
- }
- switch(pos)
- {
- case 1:
- if(_global.step == 1)
- {
- _root.gamelevel.button_1._visible = false;
- _global.rock = true;
- if(_global.rock && _global.stick && _global.sinew)
- {
- _global.step = 2;
- }
- return true;
- }
- break;
- case 2:
- if(_global.step == 1)
- {
- _root.gamelevel.button_2._visible = false;
- _global.stick = true;
- if(_global.rock && _global.stick && _global.sinew)
- {
- _global.step = 2;
- }
- return true;
- }
- break;
- case 3:
- if(_global.step == 1)
- {
- _root.gamelevel.button_3._visible = false;
- _global.sinew = true;
- if(_global.rock && _global.stick && _global.sinew)
- {
- _global.step = 2;
- }
- return true;
- }
- break;
- case 4:
- if(_global.step == 2)
- {
- _global.screenX = -190;
- _global.step = 3;
- _global.stick2 = true;
- return true;
- }
- break;
- case 5:
- if(_global.step == 3)
- {
- _global.step = 4;
- return true;
- }
- if(_global.step == 2)
- {
- return true;
- }
- break;
- case 6:
- if(_global.step == 4)
- {
- _global.flint = true;
- return true;
- }
- break;
- case 7:
- if(_global.step == 4)
- {
- return true;
- }
- break;
- case 8:
- if(_global.step == 4)
- {
- _root.gamelevel.button_8._visible = false;
- _global.step = 5;
- return true;
- }
- break;
- case 9:
- if(_global.step == 5)
- {
- return true;
- }
- break;
- case 10:
- if(_global.step == 5)
- {
- _global.wolvesfed = true;
- _global.buttonVis([]);
- return true;
- }
- break;
- }
- return false;
- };
- _global.buttonCheck = function(flag)
- {
- trace("CHECKIN");
- _global.walking = false;
- _root.step_txt.text = "step - " + _global.step;
- _root.pos_txt.text = "pos - " + _global.cavemanPos;
- switch(_global.cavemanPos)
- {
- case 1:
- if(_global.rock && _global.stick && _global.sinew)
- {
- setTimeout(addItem,1500,17);
- _global.buttonVis(["button_4","button_5"]);
- }
- return 1;
- case 2:
- if(_global.rock && _global.stick && _global.sinew)
- {
- setTimeout(addItem,1500,17);
- _global.buttonVis(["button_4","button_5"]);
- }
- return 1;
- case 3:
- if(_global.rock && _global.stick && _global.sinew)
- {
- setTimeout(addItem,1500,17);
- _global.buttonVis(["button_4","button_5"]);
- }
- return 1;
- case 4:
- _global.buttonVis(["button_5"]);
- return 1;
- case 5:
- if(_global.stick2)
- {
- return 1;
- }
- return 2;
- break;
- case 6:
- return 1;
- case 7:
- _global.buttonVis(["button_8"]);
- return 1;
- case 8:
- return 1;
- case 9:
- return 1;
- case 10:
- return 3;
- default:
- return 1;
- }
- };
- break;
- case 4:
- _root.attachMovie("level4","gamelevel",1);
- _root.gamelevel._x = -40;
- _global.screenX = -40;
- _global.screenY = 0;
- _global.charcoal = false;
- _global.art = false;
- _global.buttonVis = function(btn)
- {
- _root.gamelevel.button_1._visible = false;
- _root.gamelevel.button_2._visible = false;
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_5_._visible = false;
- _root.gamelevel.button_6._visible = false;
- _root.gamelevel.button_7._visible = false;
- i = 0;
- while(i < btn.length)
- {
- var _loc2_ = btn[i];
- _root.gamelevel[_loc2_]._visible = true;
- i++;
- }
- };
- _global.buttonVis(["button_1"]);
- _global.stepTrue = function(pos)
- {
- if(pos == _global.cavemanPos)
- {
- return false;
- }
- switch(pos)
- {
- case 1:
- if(_global.step == 1)
- {
- _global.buttonVis(["button_2"]);
- _global.step = 2;
- return true;
- }
- break;
- case 2:
- if(_global.step == 2)
- {
- _global.buttonVis(["button_5_"]);
- if(_global.cavemanPos == 1)
- {
- _global.step = 3;
- }
- return true;
- }
- break;
- case 3:
- if(_global.step == 3)
- {
- _global.buttonVis(["button_5_","button_4"]);
- _global.step = 4;
- return true;
- }
- break;
- case 4:
- if(_global.step == 4)
- {
- _global.step = 5;
- return true;
- }
- break;
- case 5:
- if(_global.step > 1)
- {
- return true;
- }
- break;
- case 6:
- if(_global.step == 5)
- {
- trace("CHARCOAL = " + _global.charcoal);
- if(_global.charcoal)
- {
- _global.buttonVis(["button_5"]);
- _root.gamelevel.char._visible = false;
- _root.gamelevel.caveman_4_6_._x = 0;
- _root.gamelevel.caveman_4_6_._y = 0;
- _root.gamelevel.caveman_4_6_._alpha = 100;
- _root.gamelevel.caveman_4_6_.play();
- _global.walking = true;
- }
- else
- {
- _root.gamelevel.char._visible = false;
- _root.gamelevel.caveman_4_6._x = 0;
- _root.gamelevel.caveman_4_6._y = 0;
- _root.gamelevel.caveman_4_6._alpha = 100;
- _root.gamelevel.caveman_4_6.play();
- _global.walking = true;
- }
- }
- break;
- case 7:
- if(_global.step == 5)
- {
- _global.buttonVis(["button_5","button_6"]);
- _global.charcoal = true;
- trace("GOT CHARCOAL");
- return true;
- }
- break;
- }
- return false;
- };
- _global.buttonCheck = function(flag)
- {
- trace("CHECKIN");
- _global.walking = false;
- _root.step_txt.text = "step - " + _global.step;
- _root.pos_txt.text = "pos - " + _global.cavemanPos;
- switch(_global.cavemanPos)
- {
- case 1:
- return 15;
- case 2:
- return 15;
- case 3:
- return 15;
- case 4:
- return 1;
- case 5:
- return 1;
- case 6:
- return 1;
- case 7:
- return 1;
- default:
- return 1;
- }
- };
- break;
- case 5:
- _root.attachMovie("level5","gamelevel",1);
- _global.screenX = 0;
- _global.screenY = 0;
- _global.hiding = false;
- _global.bow = false;
- _global.sinew = false;
- _global.arrows = false;
- _global.feathers = false;
- _global.gotbow = false;
- _global.leaves = false;
- _global.pit = false;
- _global.mammothCharge = false;
- _global.mammothDir = -1;
- _global.buttonVis = function(btn)
- {
- _root.gamelevel.button_1._visible = false;
- _root.gamelevel.button_2._visible = false;
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_6._visible = false;
- _root.gamelevel.button_7._visible = false;
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_9._visible = false;
- i = 0;
- while(i < btn.length)
- {
- var _loc2_ = btn[i];
- _root.gamelevel[_loc2_]._visible = true;
- i++;
- }
- };
- _global.buttonVis(["button_1","button_2","button_3","button_4","button_8"]);
- _global.mammothTurn = false;
- _root.gamelevel.onEnterFrame = function()
- {
- if(_global.mammothCharge && !_global.mammothTurn)
- {
- _root.gamelevel.mammoth._x += 5 * _global.mammothDir;
- if(_root.gamelevel.mammoth._x < 100 && _global.mammothDir == -1)
- {
- _global.mammothDir = 1;
- _global.mammothTurn = true;
- _root.gamelevel.mammoth.gotoAndStop(3);
- }
- else if(_root.gamelevel.mammoth._x > 556 && !_global.pit)
- {
- _global.mammothDir = -1;
- _global.mammothCharge = false;
- _root.gamelevel.mammoth.gotoAndStop(5);
- }
- else if(_root.gamelevel.mammoth._x > 680)
- {
- _global.mammothDir = -1;
- _global.mammothCharge = false;
- _root.gamelevel.mammoth.gotoAndStop(6);
- }
- if(!_global.hiding && _global.cavemanPos != 4 && _global.cavemanPos != 2 && _global.cavemanPos != 7)
- {
- if(_root.gamelevel.mammoth._x - 25 < _root.gamelevel.char._x && _global.mammothDir == -1 && _root.gamelevel.mammoth._x > _root.gamelevel.char._x)
- {
- _global.walking = true;
- _global.mammothCharge = false;
- _root.gamelevel.mammoth.gotoAndStop(7);
- }
- if(_root.gamelevel.mammoth._x + 25 > _root.gamelevel.char._x && _global.mammothDir == 1 && _root.gamelevel.mammoth._x < _root.gamelevel.char._x)
- {
- _global.walking = true;
- _global.mammothCharge = false;
- _root.gamelevel.mammoth.gotoAndStop(8);
- }
- }
- }
- };
- _root.gamelevel.mammoth.btn.onPress = function()
- {
- if(!_global.walking && !_global.mammothCharge)
- {
- if(_global.cavemanPos == 4)
- {
- _root.gamelevel.char.gotoAndStop(14);
- }
- else
- {
- _root.gamelevel.char.gotoAndStop(13);
- }
- _root.gamelevel.mammoth.btn._visible = false;
- }
- };
- _global.goMammoth = function()
- {
- _root.gamelevel.mammoth.gotoAndStop(2);
- _global.mammothCharge = true;
- _global.mammothTurn = false;
- };
- _root.gamelevel.mammoth.btn.tabEnabled = false;
- _root.gamelevel.mammoth.btn._visible = false;
- _global.checkBow = function()
- {
- if(_global.bow && _global.sinew && _global.arrows && _global.feathers && !_global.gotbow)
- {
- _global.gotbow = true;
- _global.step = 2;
- _root.gamelevel.button_5._visible = true;
- _root.gamelevel.mammoth.btn._visible = true;
- }
- };
- _global.stepTrue = function(pos)
- {
- if(pos == 8 && (_global.cavemanPos == 5 || _global.cavemanPos == 3 || _global.cavemanPos == 1 || _global.cavemanPos == 0))
- {
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_9._visible = true;
- _global.walking = true;
- _global.hiding = true;
- _root.gamelevel.char.gotoAndStop(9);
- return false;
- }
- if(_global.mammothCharge && pos != 7 && pos != 6)
- {
- return false;
- }
- if(pos == _global.cavemanPos)
- {
- return false;
- }
- switch(pos)
- {
- case 1:
- if(_global.cavemanPos != 8 && _global.step == 1 && !_global.gotbow || _global.cavemanPos == 8 && _global.oldPos == pos)
- {
- _global.arrowMC = "arrow1";
- _root.gamelevel.button_8._visible = true;
- _root.gamelevel.button_1._visible = false;
- _global.bow = true;
- _global.checkBow();
- return true;
- }
- break;
- case 2:
- if((_global.step == 1 || _global.step == 2) && _global.cavemanPos != 8)
- {
- _global.arrowMC = "arrow2";
- _global.sinew = true;
- _global.checkBow();
- if(_global.leaves)
- {
- _global.arrowMC = "arrow2_2";
- _global.screenX = -273;
- _root.gamelevel.mammoth.btn._visible = true;
- }
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_2._visible = false;
- return true;
- }
- break;
- case 3:
- if(_global.cavemanPos != 8 && _global.step == 1 && !_global.gotbow || _global.cavemanPos == 8 && _global.oldPos == pos)
- {
- _global.arrowMC = "arrow3";
- _root.gamelevel.button_8._visible = true;
- _root.gamelevel.button_3._visible = false;
- _global.arrows = true;
- _global.checkBow();
- return true;
- }
- break;
- case 4:
- if(_global.step == 1 && !_global.gotbow && _global.cavemanPos != 8)
- {
- _global.arrowMC = "arrow4";
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_4._visible = false;
- _global.feathers = true;
- _global.checkBow();
- return true;
- }
- break;
- case 5:
- if(_global.cavemanPos != 8 && _global.step == 2 && _global.gotbow || _global.cavemanPos == 8 && _global.oldPos == pos)
- {
- _global.arrowMC = "arrow5";
- _root.gamelevel.mammoth.btn._visible = true;
- _root.gamelevel.button_8._visible = true;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_2._visible = true;
- _root.gamelevel.button_6._visible = true;
- _root.gamelevel.button_7._visible = true;
- _global.leaves = true;
- return true;
- }
- break;
- case 6:
- if(_global.leaves)
- {
- _root.gamelevel.button_6._visible = false;
- return true;
- }
- break;
- case 7:
- if(_global.pit)
- {
- _root.gamelevel.button_7._visible = false;
- _root.gamelevel.char._x = 800;
- return true;
- }
- break;
- case 8:
- if(_global.cavemanPos == 1 || _global.cavemanPos == 3 || _global.cavemanPos == 5)
- {
- _root.gamelevel.button_8_5._visible = true;
- _root.gamelevel.button_8._visible = false;
- }
- break;
- case 8.5:
- if(_global.cavemanPos == 1 || _global.cavemanPos == 3 || _global.cavemanPos == 5)
- {
- _root.gamelevel.button_8_5._visible = false;
- _root.gamelevel.button_8._visible = true;
- }
- }
- return false;
- };
- _global.buttonCheck = function(flag)
- {
- _global.walking = false;
- _root.step_txt.text = "step - " + _global.step;
- _root.pos_txt.text = "pos - " + _global.cavemanPos;
- switch(_global.cavemanPos)
- {
- case 1:
- if(_global.sinew)
- {
- setTimeout(addItem,1500,16);
- }
- return 1;
- case 2:
- if(!_global.leaves)
- {
- if(_global.bow)
- {
- setTimeout(addItem,1500,16);
- }
- }
- return 1;
- case 3:
- if(_global.feathers)
- {
- setTimeout(addItem,1500,15);
- }
- return 1;
- case 4:
- if(_global.arrows)
- {
- setTimeout(addItem,1500,15);
- }
- return 6;
- case 5:
- return 1;
- case 6:
- _global.pit = true;
- return 1;
- case 7:
- return 1;
- case 8:
- return 6;
- case 9:
- return 1;
- case 10:
- return 3;
- case 11:
- return 1;
- case 12:
- return 1;
- default:
- return 1;
- }
- };
- break;
- case 6:
- _root.attachMovie("level6","gamelevel",1);
- _root.gamelevel._y = -200;
- _global.screenX = 0;
- _global.screenY = -200;
- _global.fire = false;
- _global.armoury = false;
- _global.flint = false;
- _global.firethrow = false;
- _global.stone = false;
- _global.buttonVis = function(btn)
- {
- _root.gamelevel.button_1._visible = false;
- _root.gamelevel.button_2._visible = false;
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_6._visible = false;
- _root.gamelevel.button_7._visible = false;
- _root.gamelevel.button_8._visible = false;
- _root.gamelevel.button_9._visible = false;
- _root.gamelevel.button_10._visible = false;
- _root.gamelevel.button_11._visible = false;
- i = 0;
- while(i < btn.length)
- {
- var _loc2_ = btn[i];
- _root.gamelevel[_loc2_]._visible = true;
- i++;
- }
- };
- _global.buttonVis(["button_1"]);
- _root.gamelevel.stone.onPress = function()
- {
- _global.walking = true;
- _root.gamelevel.char.gotoAndStop(12);
- };
- _global.stepTrue = function(pos)
- {
- if(pos != 10)
- {
- if(pos == _global.cavemanPos)
- {
- return false;
- }
- }
- switch(pos)
- {
- case 1:
- if(_global.step == 1)
- {
- _global.stick = true;
- return true;
- }
- break;
- case 2:
- if(_global.step == 1)
- {
- return true;
- }
- break;
- case 3:
- if(_global.step == 1)
- {
- _root.gamelevel.button_4._visible = true;
- _root.gamelevel.button_3._visible = false;
- _global.fire = true;
- return true;
- }
- break;
- case 4:
- if(_global.step == 1)
- {
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_3._visible = true;
- return true;
- }
- break;
- case 5:
- if(_global.step == 1)
- {
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_6._visible = false;
- return true;
- }
- break;
- case 6:
- if(_global.step == 1)
- {
- _root.gamelevel.button_3._visible = false;
- _root.gamelevel.button_4._visible = false;
- _root.gamelevel.button_5._visible = false;
- _root.gamelevel.button_6._visible = false;
- return true;
- }
- break;
- case 7:
- if(_global.step == 1)
- {
- return true;
- }
- break;
- case 8:
- _global.buttonVis(["button_9"]);
- if(_global.step == 1)
- {
- _global.step = 2;
- return true;
- }
- break;
- case 9:
- if(_global.step == 2)
- {
- _global.buttonVis(["button_10"]);
- _global.step = 3;
- return true;
- }
- break;
- case 11:
- _root.gamelevel.caveman_9_10.play();
- _root.gamelevel.button_11._visible = false;
- break;
- default:
- break;
- case 10:
- if(_global.step == 3)
- {
- _root.gamelevel.button_10._visible = false;
- }
- return true;
- }
- return false;
- };
- _global.buttonCheck = function(flag)
- {
- trace("CHECKIN");
- _global.walking = false;
- _root.step_txt.text = "step - " + _global.step;
- _root.pos_txt.text = "pos - " + _global.cavemanPos;
- switch(_global.cavemanPos)
- {
- case 1:
- _global.walking = true;
- return 1;
- case 2:
- _global.buttonVis(["button_3","button_4","button_5","button_6"]);
- _global.screenX = -108;
- _global.screenY = -435;
- return 1;
- case 3:
- return 1;
- case 4:
- if(!_global.fire)
- {
- return 1;
- }
- _global.armoury = true;
- return 1;
- break;
- case 5:
- _global.walking = true;
- return 1;
- case 6:
- return 1;
- case 7:
- _global.walking = true;
- return 1;
- case 8:
- return 1;
- case 9:
- return 1;
- case 10:
- return 1;
- default:
- return 1;
- }
- };
- }
- _root.attachMovie("timer_mc","timer_mc",300);
- _root.timer_mc.time_txt.text = _global.timer;
- _root.timer_mc.time_txt2.text = _global.timer;
- _root.timer_mc.pause_btn._visible = false;
- _root.attachMovie("mask_mc","mask_mc",250);
- _root.attachMovie("mask_mc","mask_mc2",251);
- _root.gamelevel.setMask("mask_mc");
- _root.skybackground.setMask("mask_mc2");
- };
- this.onEnterFrame = function()
- {
- if(!_root.paws)
- {
- _global.timeStep = _global.timeStep + 1;
- if(_global.timeStep == 24)
- {
- _global.timeStep = 0;
- _global.timer = _global.timer - 1;
- if(_global.timer == -1)
- {
- _global.timer = 0;
- }
- _root.timer_mc.time_txt.text = _global.timer;
- _root.timer_mc.time_txt2.text = _global.timer;
- }
- if(_global.item)
- {
- _root.gamelevel.item._y--;
- if(_root.gamelevel.item._y < -20)
- {
- _root.gamelevel.item._alpha--;
- }
- if(_root.gamelevel.item._alpha < 0)
- {
- _root.gamelevel.item.removeMovieClip();
- _global.item = false;
- }
- }
- if(_root.gamelevel._x > _global.screenX)
- {
- _root.gamelevel._x -= 2;
- }
- if(_root.gamelevel._x < _global.screenX)
- {
- _root.gamelevel._x += 2;
- }
- if(_root.gamelevel._y > _global.screenY)
- {
- _root.gamelevel._y -= 2;
- }
- if(_root.gamelevel._y < _global.screenY)
- {
- _root.gamelevel._y += 2;
- }
- }
- };
- _global.deadPopUp = function()
- {
- _root.score = game.score;
- _root.paws = true;
- _root.timer_mc.pause_btn._visible = false;
- stopAllSounds();
- _root.paws = true;
- _root.attachMovie("dead","dead",2);
- _root.dead.score_txt.text = game.score;
- _root.dead.score_txt2.text = game.score;
- _root.dead.replay_btn.onPress = function()
- {
- removeMovieClip(_root.mask_mc2);
- removeMovieClip(_root.mask_mc);
- removeMovieClip(_root.skybackground);
- removeMovieClip(_root.dead);
- loadLevel(game.level);
- };
- _root.dead.main_btn.onPress = function()
- {
- game.score = 0;
- removeMovieClip(_root.mask_mc);
- removeMovieClip(_root.mask_mc2);
- removeMovieClip(_root.gamelevel);
- removeMovieClip(_root.skybackground);
- removeMovieClip(_root.dead);
- removeMovieClip(_root.timer_mc);
- stopAllSounds();
- _root.secondPlay = true;
- _root.play();
- };
- };
- _global.winLevelPopUp = function()
- {
- _root.paws = true;
- _root.timer_mc.pause_btn._visible = false;
- stopAllSounds();
- _root.attachMovie("dead","winlevel",2);
- _root.winlevel.gotoAndStop(2);
- _root.winlevel.bonus_txt.text = _global.timer * 10;
- _root.winlevel.bonus_txt2.text = _global.timer * 10;
- game.score += _global.timer * 10;
- game.score += 100 * game.level;
- _root.winlevel.score_txt.text = game.score;
- _root.winlevel.level_txt.text = 100 * game.level;
- _root.score = game.score;
- _root.winlevel.btn.onPress = function()
- {
- _root.panels._visible = true;
- switch(game.level)
- {
- case 1:
- _root.panels.gotoAndStop(6);
- break;
- case 2:
- _root.panels.gotoAndStop(8);
- break;
- case 3:
- _root.panels.gotoAndStop(10);
- break;
- case 4:
- _root.panels.gotoAndStop(12);
- break;
- case 5:
- _root.panels.gotoAndStop(14);
- break;
- case 6:
- _root.panels.gotoAndStop(16);
- }
- game.level = game.level + 1;
- removeMovieClip(_root.mask_mc);
- removeMovieClip(_root.mask_mc2);
- removeMovieClip(_root.skybackground);
- removeMovieClip(_root.winlevel);
- removeMovieClip(_root.gamelevel);
- removeMovieClip(_root.timer_mc);
- };
- };
- _global.setButton = function(mc, pos)
- {
- mc.onPress = function()
- {
- if(!_root.paws)
- {
- if(pos == 9 && game.level == 5 && _global.walking)
- {
- _root.gamelevel.button_8._visible = true;
- _root.gamelevel.button_9._visible = false;
- _root.gamelevel.char.char.play();
- }
- if(!_global.walking && _global.stepTrue(pos) && !_root.paws)
- {
- _global.walking = true;
- _root.gamelevel.char._visible = false;
- var _loc3_ = "caveman_" + _global.cavemanPos + "_" + pos;
- if(_global.double)
- {
- _loc3_ = "caveman_" + _global.cavemanPos + "_" + _global.oldPos;
- }
- trace("caveman symbol = " + _loc3_);
- _root.gamelevel[_loc3_]._x = 0;
- _root.gamelevel[_loc3_]._y = 0;
- _root.gamelevel[_loc3_]._visible = true;
- _root.gamelevel[_loc3_]._alpha = 100;
- _root.gamelevel[_loc3_].gotoAndPlay(2);
- _global.debugTrace("walking from pos " + _global.cavemanPos + " to pos " + pos);
- }
- }
- };
- mc.tabEnabled = false;
- };
- break;
- }
- if(eval("\x01") == 878)
- {
- set("\x01",eval("\x01") - 276);
- }
- else
- {
- if(eval("\x01") != 465)
- {
- if(eval("\x01") == 988)
- {
- set("\x01",eval("\x01") - 988);
- }
- break;
- }
- set("\x01",eval("\x01") + 413);
- if(function §\x04\x05§()
- {
- set("\x03",1193 % 511 * true);
- return eval("\x03");
- })
- {
- set("\x01",eval("\x01") - 276);
- }
- }
- }
- }
- }
-